﻿///***************************************************************
/// 시  스  템 : Updms.Prj.Dac
/// 단위시스템 : PRJ
/// 계      층 : Data Access Layer
/// 프로그램명 : Prj_Dac_UPDMS_PRJ_REPORT_MGT
/// 파  일  명 : Prj_Dac_UPDMS_PRJ_REPORT_MGT.cs
/// 설      명 : 보고서관리
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-12-23 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;

namespace Updms.Prj.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Prj_Dac_UPDMS_PRJ_REPORT_MGT : Base.AppFramework.DacBase
	{
		public Prj_Dac_UPDMS_PRJ_REPORT_MGT()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Get_Search_Count";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [Select]
		
		[AutoComplete]
		public DataSet Select(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			//Base.AppFramework.SMEventLog.WriteParamLog(strSql, lo_dp);

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_REPORT_MGT", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion		

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Update";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion


		#region NT [GetReportInfoForEmail]
		/// <summary>
		/// 이메일발송을 위해 보고서정보를 조회한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetReportInfoForEmail(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Get_Report_Info_For_Email";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_REPORT_MGT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetReportInfoForEmailDetail]
		/// <summary>
		/// 이메일발송을 위해 보고서 추가정보를 조회한다.
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetReportInfoForEmailDetail(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Get_Report_Info_For_Email_Detail";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_PRJ_REPORT_MGT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion
		
		#region RT [SetSendYn]
		/// <summary>
		/// 메일전송성공시 Send_Yn을 'Y'로 업데이트
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int SetSendYn(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_PRJ_REPORT_MGT_Set_Send_Yn";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion
		
		
	}
}
